package com.itheima.date;

import java.time.DayOfWeek;
import java.time.LocalDateTime;

public class jdk8demo01 {
    public static void main(String[] args) {
        LocalDateTime localDateTime = LocalDateTime.of(2020, 11, 11, 11, 11, 20);
        int year = localDateTime.getYear();
        System.out.println("年"+year);
        int month = localDateTime.getMonthValue();
        System.out.println("月"+month);
        int dayOfMonth = localDateTime.getDayOfMonth();
        System.out.println("一月中的第"+dayOfMonth+"天");
        DayOfWeek dayOfWeek = localDateTime.getDayOfWeek();
        System.out.println("星期"+dayOfWeek);
        int dayOfYear = localDateTime.getDayOfYear();
        System.out.println("一年中的"+dayOfYear);
        int hour = localDateTime.getHour();
        System.out.println("时"+hour);
        int minute = localDateTime.getMinute();
        System.out.println("分"+minute);
        int second = localDateTime.getSecond();
        System.out.println("秒"+second);
    }
}
